//Thu Jun 17 15:33:17 CDT 2010
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class OnTheFarmDivTwo
{
public:
	vector<int> animals(int heads, int legs)
	{
		int chick = -1;
		if ((heads * 4 - legs) % 2 == 0)
			chick = (heads * 4 - legs) / 2;
		int cows = heads - chick;
		vector<int> ret;
		if (chick >= 0 && cows <= heads && cows >= 0)
		{
			ret.push_back(chick);
			ret.push_back(cows);
		}
		return ret;
	}
};
